<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="box1" >
        <div id="box2" >
            <div id="box3">

            </div>
        </div>
    </div>

    <script>
        var box2=document.querySelector('#box1')
        box2.onclick=function(e){
         alert(e.target)
        }
     </script>

    <style>
        #box1{
            width: 500px;
            height: 500px;
            background-color: aliceblue;
        }
        #box2{
            width: 300px;
            height: 300px;
            background-color: antiquewhite;
        }
        #box3{
            width: 200px;
            height: 200px;
            background-color: aqua;
        }
    </style>
</body>
</html>